<template>
  <!-- 输入框 -->
  <header class="header">
    <h1>小黑记事本</h1>
    <input placeholder="请输入任务" class="new-todo" v-model="taskName"/>
    <button class="add" @click="addTask">添加任务</button>
  </header>
</template>
<script>

export default {
  data(){
    return {
      taskName: ''
    }
  },
  methods:{
    addTask(){
      this.$emit("addTask", this.taskName);
    }
  }
}
</script>
<style scoped>

</style>